//
//  FCRightCollectionViewTableViewCell.m
//  siftSearch_Example
//
//  Created by WJC on 2019/5/7.
//  Copyright © 2019 64912907. All rights reserved.
//

#import "FCRightCollectionViewTableViewCell.h"
#import "WJCDefine.h"
#import "Masonry.h"
@interface FCRightCollectionViewTableViewCell()<UICollectionViewDelegate,UICollectionViewDataSource>
@end
@implementation FCRightCollectionViewTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        WJCWeakSelf
        createCommonLabel(leftL, font15, HEXC(0x646262))
        self.leftL=leftL;
        [self.contentView addSubview:self.leftL];
        [self.leftL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(16);
            make.centerY.mas_equalTo(0);
            make.width.mas_equalTo(WJCScreenW * 0.22);
        }];
        createCommonLabel(rightL, font14, HEXC(0x232323))
        self.rightL=rightL;
        [self.contentView addSubview:self.rightL];
        [self.rightL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weakSelf.leftL.mas_right).mas_offset(25);
//            make.top.mas_equalTo(11);
            make.centerY.mas_equalTo(0);
        }];
        self.rightL.hidden=YES;
    UICollectionViewFlowLayout *flowLayout=[[UICollectionViewFlowLayout alloc] init];
        //    //设置layout水平滑动
    [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];  //设置head大小
    flowLayout.itemSize=CGSizeMake(WJCScreenW * 0.24, 32);
    flowLayout.minimumInteritemSpacing=1;
    flowLayout.sectionInset=UIEdgeInsetsMake(2.5, 0, 2.5, 0);
    
        self.rightCollectionView=[[FCSiftCollectionView alloc]initWithFrame:CGRectMake(0, 25,WJCScreenW , 90)];
       
        [self.rightCollectionView.collectionView reloadData];
    [self.contentView addSubview:self.rightCollectionView];
    [self.rightCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(WJCScreenW * 0.24+16);
            make.right.mas_equalTo(-16);
            make.top.mas_equalTo(8);
            make.bottom.mas_equalTo(0);
        }];
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
